package controller.PurchaseTable;

import entity.MsgResult;
import entity.goods2;
import entity.purchase2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.SelectPurchaseBySelectiveService;

import java.util.HashMap;
import java.util.List;

@Controller
public class SelectPurchaseBySelectiveController {

    @Autowired
    private SelectPurchaseBySelectiveService selectPurchaseBySelectiveService;

    @RequestMapping("/selectPurchaseBySelective")
    @ResponseBody
    public MsgResult selectPurchaseBySelective(purchase2 purchase2){
        MsgResult msgResult = new MsgResult();
        HashMap<String, Object> map = new HashMap<>();
        List<entity.purchase2> purchases = selectPurchaseBySelectiveService.selectPurchaseBySelective(purchase2);
        map.put("purchases",purchases);
        msgResult.setFlag(1);
        msgResult.setData(map);
        return msgResult;
    }
}
